<style type="text/css">
    .bjui-pageHeader{
        font-size: 18px;
        font-weight: bold;
    }
    .form{
        padding: 15px;
    }
    .form dl {
        overflow: hidden;
        padding-top: 15px;
    }

    .form dt {
        color: #666;
        float: left;
        font-size: 14px;
        padding: 3px 0 0;
        width: 11%;
    }
    .form dd {
        float: left;
        line-height: 22px;
    }
    dd.desc {
        height: 30px;
        padding: 0 10px;
        width: 150px;
    }
</style>
<div class="bjui-pageHeader">
    <div class="glyphicon glyphicon-th-large">栏目列表</div>
    <button type="button" data-url="{:U('Category/add')}" class="btn btn-default" data-toggle="navtab" data-id="Category-add"  data-title="添加栏目" data-icon="plus">添加栏目</button>
</div>
<div class="bjui-pageContent">
    <form action="{:U('Category/sort')}" method="post" data-toggle="validate">
        <table class="table table-bordered table-hover table-striped table-top">
            <thead>
                <tr>
                    <th align="center">编号</th>
                    <th>名称</th>
                    <th>所属模型</th>
                    <th>显示</th>
                    <th>导航</th>
                    <th>排序</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                <foreach name='cate' item='v'>
                    <tr>
                        <td  align="center">{$v.id}</td>
                        <td class="aleft">
                            {$v.delimiter}
                            <if condition="$v['pid'] neq 0">├─</if>
                            {$v.name}
                    </td>
                    <td >
                        <if condition='$v.type eq 1'>
                            <span style="color:red">外部链接</span>
                            <else/>
                            {$v.modelname}
                        </if>
                    </td>
                    <td>
                        <if condition="$v['status']">
                            是
                            <else/> <font color="red">否</font>
                        </if>
                    </td>
                    <td>
                        <if condition="$v['nav']">
                            是
                            <else/> <font color="red">否</font>
                        </if>
                    </td>
                    <td>
                        <input type="text" name="{$v.id}" value="{$v.sort}" />
                    </td>
                    <td>

                        <a href="{:U('Category/add',array('pid' =>$v['id']))}" data-toggle="navtab" data-id="Category-add" data-title="添加栏目">添加子栏目</a>
                        <a href="{:U('Category/edit',array('id' =>$v['id']))}" data-toggle="navtab" data-id="category-edit" data-title="修改栏目">修改</a>
                        <a href="{:U('Category/del', array('id' =>$v['id']))}" data-toggle="doajax" data-confirm-msg="确定要删除吗？" data-type="get">删除</a>
                    </td>
                </tr>
            </foreach>
        </tbody>
    </table>
    <div class="th" style="clear: both;"></div>
</form>
</div>
<div class="bjui-pageFooter">
<ul>
    <li>
        <button type="button" class="btn-close" data-icon="close">关闭</button>
    </li>
    <li>
        <button data-icon="save" class="btn btn-default" type="submit">排序</button>
    </li>
</ul>
</div>